﻿using ExcelSystem.Model;
using ExcelSystem.ToolClass;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace ExcelSystem.ViewModelsClass
{
   public class BOMChildInfo : BindableBase
    {
       public BOMChildInfo()
        {
            TextVisibility = Visibility.Collapsed;
        }
        private string childNo;

        /// <summary>
        ///  子图号
        /// </summary>
        public string ChildNo
        {
            get { return childNo; }
            set { SetProperty(ref childNo, value); }
        }

        private string childNumber;

        /// <summary>
        ///  组件序号
        /// </summary>
        public string ChildNumber
        {
            get { return childNumber; }
            set { SetProperty(ref childNumber, value); }
        }

        private string m_Type;

        /// <summary>
        ///  类型
        /// </summary>
        public string M_Type
        {
            get { return m_Type; }
            set { 
                SetProperty(ref m_Type, value);
                if(value=="槽钢")
                {
                    ComboxVisibility = Visibility.Visible;
                    TextVisibility  = Visibility.Collapsed;
                }
                else
                {
                    ComboxVisibility = Visibility.Collapsed;
                    TextVisibility = Visibility.Visible;
                }
            }
        }

        private string size;

        /// <summary>
        ///  尺寸
        /// </summary>
        public string Size
        {
            get { return size; }
            set { SetProperty(ref size, value); }
        }

        private string weight;

        /// <summary>
        ///  重量
        /// </summary>
        public string Weight
        {
            get { return weight; }
            set { SetProperty(ref weight, value); }
        }

        private string number;

        /// <summary>
        ///  数量
        /// </summary>
        public string Number
        {
            get { return number; }
            set { SetProperty(ref number, value); }
        }
        private string remaker;

        /// <summary>
        ///  备注
        /// </summary>
        public string Remaker
        {
            get { return remaker; }
            set { SetProperty(ref remaker, value); }
        }

        private Visibility comboxVisibility;

        /// <summary>
        ///  下拉列表显示
        /// </summary>
        public Visibility ComboxVisibility
        {
            get { return comboxVisibility; }
            set { SetProperty(ref comboxVisibility, value); }
        }

        private Visibility textVisibility;

        /// <summary>
        ///  文本显示
        /// </summary>
        public Visibility TextVisibility
        {
            get { return textVisibility; }
            set { SetProperty(ref textVisibility, value); }
        }
    }

    public class BOMYM : BindableBase
    {
       

        private string materialNo;
        /// <summary>
        /// 订单物料编码
        /// </summary>
        public string MaterialNo
        {
            get { return materialNo; }
            set { SetProperty(ref materialNo, value); }
        }
        private string childMaterialNo;

        /// <summary>
        ///  子图号
        /// </summary>
        public string ChildMaterialNo
        {
            get { return childMaterialNo; }
            set { SetProperty(ref childMaterialNo, value); }
        }

        private KeyValue<string> pictrue1;

        /// <summary>
        ///  图1
        /// </summary>
        public KeyValue<string> Pictrue1
        {
            get { return pictrue1; }
            set { SetProperty(ref pictrue1, value); }
        }
        private KeyValue<string> pictrue2;

        /// <summary>
        ///  图2
        /// </summary>
        public KeyValue<string> Pictrue2
        {
            get { return pictrue2; }
            set { SetProperty(ref pictrue2, value); }
        }
        private KeyValue<string> pictrue3;

        /// <summary>
        ///  图3
        /// </summary>
        public KeyValue<string> Pictrue3
        {
            get { return pictrue3; }
            set { SetProperty(ref pictrue3, value); }
        }



        private string remark;
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark
        {
            get { return remark; }
            set { SetProperty(ref remark, value); }
        }

        private string par;

        /// <summary>
        /// 注意
        /// </summary>
        public string Par
        {
            get { return par; }
            set { SetProperty(ref par, value); }
        }

        private ObservableCollection<BOMChildInfo> bomChildInfos;

        /// <summary>
        /// 子件信息
        /// </summary>
        public ObservableCollection<BOMChildInfo> BOMChildInfo
        {
            get { return bomChildInfos; }
            set { SetProperty(ref bomChildInfos, value); }
        }



        
    }
}
